/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Alex
 */
@Entity
@Table(catalog = "", schema = "nasa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Psicologo.findAll", query = "SELECT p FROM Psicologo p"),
    @NamedQuery(name = "Psicologo.findByPsicId", query = "SELECT p FROM Psicologo p WHERE p.psicId = :psicId"),
    @NamedQuery(name = "Psicologo.findByPsicNome", query = "SELECT p FROM Psicologo p WHERE p.psicNome = :psicNome"),
    @NamedQuery(name = "Psicologo.findByPsicEmail", query = "SELECT p FROM Psicologo p WHERE p.psicEmail = :psicEmail"),
    @NamedQuery(name = "Psicologo.findByPsicLogin", query = "SELECT p FROM Psicologo p WHERE p.psicLogin = :psicLogin"),
    @NamedQuery(name = "Psicologo.findByPsicSenha", query = "SELECT p FROM Psicologo p WHERE p.psicSenha = :psicSenha")})
public class Psicologo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "psic_id", nullable = false)
    private Integer psicId;
    @Basic(optional = false)
    @Column(name = "psic_nome", nullable = false, length = 45)
    private String psicNome;
    @Basic(optional = false)
    @Column(name = "psic_email", nullable = false, length = 45)
    private String psicEmail;
    @Column(name = "psic_login", length = 45)
    private String psicLogin;
    @Column(name = "psic_senha", length = 45)
    private String psicSenha;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "grupoPsicologo")
    private List<Grupo> grupoList;

    public Psicologo() {
    }

    public Psicologo(Integer psicId) {
        this.psicId = psicId;
    }

    public Psicologo(Integer psicId, String psicNome, String psicEmail) {
        this.psicId = psicId;
        this.psicNome = psicNome;
        this.psicEmail = psicEmail;
    }

    public Integer getPsicId() {
        return psicId;
    }

    public void setPsicId(Integer psicId) {
        this.psicId = psicId;
    }

    public String getPsicNome() {
        return psicNome;
    }

    public void setPsicNome(String psicNome) {
        this.psicNome = psicNome;
    }

    public String getPsicEmail() {
        return psicEmail;
    }

    public void setPsicEmail(String psicEmail) {
        this.psicEmail = psicEmail;
    }

    public String getPsicLogin() {
        return psicLogin;
    }

    public void setPsicLogin(String psicLogin) {
        this.psicLogin = psicLogin;
    }

    public String getPsicSenha() {
        return psicSenha;
    }

    public void setPsicSenha(String psicSenha) {
        this.psicSenha = psicSenha;
    }

    @XmlTransient
    public List<Grupo> getGrupoList() {
        return grupoList;
    }

    public void setGrupoList(List<Grupo> grupoList) {
        this.grupoList = grupoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (psicId != null ? psicId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Psicologo)) {
            return false;
        }
        Psicologo other = (Psicologo) object;
        if ((this.psicId == null && other.psicId != null) || (this.psicId != null && !this.psicId.equals(other.psicId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Psicologo[ psicId=" + psicId + " ]";
    }
    
}
